<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('执行网关配置列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								系统编号：<input type="text" name="systemNo"/>
							</li>

							<li>
								系统名称:<input type="text" name="systemName"/>
							</li>
							<li>
								系统分类：<select name="stId" th:with="type=${@dict.getType('st_id')}">
								<option value="">所有</option>
								<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
										th:value="${dict.dictValue}"></option>
							</select>
							</li>


							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:systemSet:add">
					<i class="fa fa-plus"></i> 添加
				</a>
				<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="system:systemSet:edit">
					<i class="fa fa-edit"></i> 修改
				</a>
				<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:systemSet:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:systemSet:export">
						<i class="fa fa-download"></i> 导出
				 </a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:systemSet:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:systemSet:remove')}]];
        var prefix = ctx + "system/systemSet";

        var stIds =[[${@dict.getType('st_id')}]];


        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "执行网关配置",
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
                {
                    field : 'id',
                    title : '主键id',
                    visible: false
                },
				{
					field : 'systemType', 
					title : '系统类型',
					visible: false
				},
				{
					field : 'systemNo', 
					title : '系统编号',
					sortable: true
				},
                {
                    field : 'stId',
                    title : '系统分类',
                    formatter : function (value, item, index) {
                        return $.table.selectDictLabel(stIds, item.stId);
                    }
                },
				{
					field : 'systemName', 
					title : '系统名称',
					sortable: true
				},
				{
					field : 'ipAddr', 
					title : 'IP地址',
					sortable: true
				},
				{
					field : 'pORT', 
					title : '端口号',
					sortable: true
				},
				{
					field : 'destNo', 
					title : '节点号',
					sortable: true
				},
				{
					field : 'functionNo', 
					title : '主功能号',
					sortable: true
				},
				{
					field : 'dbName', 
					title : '数据库名',
					sortable: true
				},
				{
					field : 'userId', 
					title : '用户名',
					sortable: true
				},
				{
					field : 'userPwd', 
					title : '密码',
					sortable: true
				},
				{
					field : 'callAddr', 
					title : '请求地址',
					sortable: true
				},

				{
					field : 'destNo1', 
					title : '节点1',
                    visible: false
				},
				{
					field : 'destNo2', 
					title : '节点2',
                    visible: false
				},
				{
					field : 'destNo3', 
					title : '节点3',
                    visible: false
				},
				{
					field : 'destNo4', 
					title : '节点4',
                    visible: false
				},
				{
					field : 'functionNo1', 
					title : '主功能号1',
                    visible: false
				},
				{
					field : 'functionNo2', 
					title : '主功能号2',
                    visible: false
				},
				{
					field : 'destNo5', 
					title : '节点5',
                    visible: false
				},
				{
					field : 'destNo6', 
					title : '节点6',
                    visible: false
				},
				{
					field : 'destNo7', 
					title : '节点7',
                    visible: false
				},
				{
					field : 'destNo8', 
					title : '节点8',
                    visible: false
				},
				{
					field : 'destNo9', 
					title : '节点9',
                    visible: false
				},
				{
					field : 'destNo10', 
					title : '节点10',
                    visible: false
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>